#!/bin/sh
#
# Copyright (c) 2004, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place - Suite 330, Boston, MA 02111-1307 USA.
#
# Authors:
#     Mi,Jun  <jun.mi@intel.com>
#

buildable="";

while true
do
  case "$1" in
      "--buildable")
          buildable="( -name *.c )";
          shift;
          ;;
      --*)
          echo "Unknown option $1" 1>&2;
          usage 1>&2;
          exit 1;
          ;;
      *)
          break 2;
          ;;
  esac
done

if [ -z "$1" ]
then
    echo "Error: no root directory specified" 1>&2
    exit 1;
fi

WHERE="$1"

find "$WHERE" -type f \
    \( \
       \( -name "*.c"  \) \
       ! -name \*.o ! -name \*~  \
    \)
